package com.xmut.mall.member.vo;

import lombok.Data;

import java.math.BigDecimal;

@Data
public class PriceDetailDTO {

    /**
     * 订单原始总价格
     */
    private BigDecimal originalPrice;

    /**
     * 商品总金额（商品原价）
     */
    private BigDecimal goodsPrice;

    /**
     * 配送费
     */
    private BigDecimal freightPrice;

    /**
     * 支付积分
     */
    private Long payPoint;

    /**
     * 优惠金额
     */
    private BigDecimal discountPrice;

    /**
     * 优惠券金额
     */
    private BigDecimal couponPrice;

    /**
     * 单品分销返现支出
     */
    private BigDecimal distributionCommission;

    /**
     * 平台收取交易佣金比例
     */
    private BigDecimal platFormCommissionPoint;

    /**
     * 平台收取交易佣金=(flowPrice(流水金额) * platFormCommissionPoint(平台佣金比例))/100
     */
    private BigDecimal platFormCommission;

    //========= platform coupon==========

    /**
     * 平台优惠券 使用金额
     */
    private BigDecimal siteCouponPrice;

    /**
     * 站点优惠券佣金比例
     */
    private BigDecimal siteCouponPoint;

    /**
     * 站点优惠券佣金
     */
    private BigDecimal siteCouponCommission;
    //=========end platform coupon==========

    //========= update price ==========

    /**
     * 订单修改金额
     */
    private BigDecimal updatePrice;

    //=========end update price==========

    /**
     * 流水金额(入账 出帐金额) = " +
     * "goodsPrice(商品总金额（商品原价）) + freightPrice(配送费) - " +
     * "discountPrice(优惠金额) - couponPrice(优惠券金额) + updatePrice(订单修改金额)
     */
    private BigDecimal flowPrice;

    /**
     * 结算价格 与 商家/供应商 结算价格（例如积分商品/砍价商品）
     */
    private BigDecimal settlementPrice;

    /**
     * 最终结算金额 = flowPrice(流水金额) - platFormCommission(平台收取交易佣金) - distributionCommission(单品分销返现支出)
     */
    private BigDecimal billPrice;

    /**
     * 总件数
     * @return
     */
    private Long totalNum;

    //    /**
//     * 参与的促销活动
//     */
//    @ApiModelProperty(value = "参与的促销活动")
//    private List<PromotionSkuVO> joinPromotion;
    public BigDecimal getOriginalPrice() {
        return originalPrice == null ? BigDecimal.ZERO : originalPrice;
    }


    public BigDecimal getGoodsPrice() {
        return goodsPrice == null ? BigDecimal.ZERO : goodsPrice;
    }

    public BigDecimal getFreightPrice() {
        return freightPrice == null ? BigDecimal.ZERO : freightPrice;
    }

    public Long getPayPoint() {
        if (payPoint == null || payPoint <= 0) {
            return 0L;
        }
        return payPoint;
    }

    public BigDecimal getDiscountPrice() {
        return discountPrice == null ? BigDecimal.ZERO : discountPrice;
    }

    public BigDecimal getCouponPrice() {
        return couponPrice == null ? BigDecimal.ZERO : couponPrice;
    }

    public BigDecimal getDistributionCommission() {
        return distributionCommission == null ? BigDecimal.ZERO : distributionCommission;
    }

    public BigDecimal getPlatFormCommission() {
        return platFormCommission == null ? BigDecimal.ZERO : platFormCommission;
    }

    public BigDecimal getSiteCouponPrice() {
        return siteCouponPrice == null ? BigDecimal.ZERO : siteCouponPrice;
    }

    public BigDecimal getSiteCouponPoint() {
        return siteCouponPoint == null ? BigDecimal.ZERO : siteCouponPoint;
    }

    public BigDecimal getSiteCouponCommission() {
        return siteCouponCommission == null ? BigDecimal.ZERO : siteCouponCommission;
    }

    public BigDecimal getFlowPrice() {
        return flowPrice == null ? BigDecimal.ZERO : flowPrice;
    }

    public BigDecimal getSettlementPrice() {
        return settlementPrice == null ? BigDecimal.ZERO : settlementPrice;
    }

    public BigDecimal getBillPrice() {
        return billPrice == null ? BigDecimal.ZERO : billPrice;
    }

    public BigDecimal getUpdatePrice() {
        return updatePrice == null ? BigDecimal.ZERO : updatePrice;
    }

    public PriceDetailDTO() {
        originalPrice = BigDecimal.ZERO;
        goodsPrice = BigDecimal.ZERO;
        freightPrice = BigDecimal.ZERO;

        payPoint = 0l;
        discountPrice = BigDecimal.ZERO;
        couponPrice = BigDecimal.ZERO;

        distributionCommission = BigDecimal.ZERO;
        platFormCommissionPoint = BigDecimal.ZERO;
        platFormCommission = BigDecimal.ZERO;

        siteCouponPrice = BigDecimal.ZERO;
        siteCouponPoint = BigDecimal.ZERO;
        siteCouponCommission = BigDecimal.ZERO;

        updatePrice = BigDecimal.ZERO;

        flowPrice = BigDecimal.ZERO;
        billPrice = BigDecimal.ZERO;
        settlementPrice = BigDecimal.ZERO;
    }


}
